;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages moviepy)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages check)
  #:use-module (gnu packages python-check)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz))

(define-public python-proglog
  (package
    (name "python-proglog")
    (version "0.1.10")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "proglog" version))
        (sha256
          (base32 "1d6s9mg2fr3dr30x05cvsvw25kpakkzqyj2zyarawk1fr34ji335"))))
    (build-system python-build-system)
    (propagated-inputs (list python-tqdm))
    (home-page "")
    (synopsis "Log and progress bar manager for console, notebooks, web...")
    (description "Log and progress bar manager for console, notebooks, web...")
    (license license:expat)))

(define-public python-moviepy
  (package
    (name "python-moviepy")
    (version "1.0.3")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "moviepy" version))
        (sha256
          (base32 "1x9klj7saywyh2ycj24imvbxpzbvpb2n7rw9zyrps1w82xfy7118"))))
    (build-system python-build-system)
    (propagated-inputs
      (list python-decorator
            python-imageio
            python-imageio-ffmpeg
            python-proglog
            python-requests
            python-tqdm))
    (native-inputs
      (list python-coverage
            python-coveralls
            python-pytest
            python-pytest-cov
            python-requests))
    (arguments
      '(#:tests? #f
        #:phases
        (modify-phases %standard-phases
          (replace 'check
            (lambda* (#:key tests? inputs outputs #:allow-other-keys)
              (when tests?
                (invoke "pytest" "-vv"))))
;; todo: update python decorator package
;; validating 'moviepy'
;; /gnu/store/xr0firqvh90zb1yjzhjby2hqgdcgy0qg-python-moviepy-1.0.3/lib/python3.9/site-packages
;; ...checking requirements: ERROR:
;; moviepy==1.0.3 ContextualVersionConflict(decorator 5.0.9
;; (/gnu/store/f0aa3qbah14mgmwdl6xn0wbnhm15b0jm-python-decorator-5.0.9/lib/python3.9/site-packages),
;; Requirement.parse('decorator<5.0,>=4.0.2'), {'moviepy'})
          (delete 'sanity-check))))
    (home-page "https://zulko.github.io/moviepy/")
    (synopsis "Video editing with Python")
    (description "Video editing with Python")
    (license license:expat)))

(define-public python-imageio-ffmpeg
  (package
    (name "python-imageio-ffmpeg")
    (version "0.4.7")
    (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "imageio-ffmpeg" version))
        (sha256
          (base32 "0gkjkrmgbdcfqx010hp23ymrkp1zzmjbh88qliyf6qzkjy7q623s"))))
    (build-system python-build-system)
    (home-page "https://github.com/imageio/imageio-ffmpeg")
    (synopsis "FFMPEG wrapper for Python")
    (description "FFMPEG wrapper for Python")
    (license license:bsd-2)))

